import request from '@/utils/request'

// 查询科目管理列表
export function listSubject(query) {
  return request({
    url: '/exam/subject/list',
    method: 'get',
    params: query
  })
}

/**
 * 获取所有科目
 * @returns 
 */
export function listAllSubject() {
  return request({
    url: '/exam/subject/all',
    method: 'get'
  })
}

// 查询科目管理详细
export function getSubject(id) {
  return request({
    url: '/exam/subject/' + id,
    method: 'get'
  })
}

// 新增科目管理
export function addSubject(data) {
  return request({
    url: '/exam/subject',
    method: 'post',
    data: data
  })
}

// 修改科目管理
export function updateSubject(data) {
  return request({
    url: '/exam/subject',
    method: 'put',
    data: data
  })
}

// 删除科目管理
export function delSubject(id) {
  return request({
    url: '/exam/subject/' + id,
    method: 'delete'
  })
}

// 查询科目试卷列表
export function getSubjectPapers(id, query) {
  return request({
    url: '/exam/subjectPaper/list/' + id,
    method: 'get',
    params: query
  })
}

// 新增科目试卷管理
export function addSubjectPapers(data) {
  return request({
    url: '/exam/subjectPaper',
    method: 'post',
    data: data
  })
}

// 删除科目管理
export function deleteSubjectPaper(id) {
  return request({
    url: '/exam/subjectPaper/' + id,
    method: 'delete'
  })
}

// 查询科目下没有的试卷列表
export function selectNotAddSubjectPaperList(subjectId, query) {
  return request({
    url: '/exam/subjectPaper/selectNotAddSubjectPaperList/' + subjectId,
    method: 'get',
    params: query

  })
}
